<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<#include "/views/ftl/base/manager_include.ftl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>举报列表</title>
<style>
A{
color: #333;
}

</style>
<script type="text/javascript">
$().ready(function() {
	$("#search_button").click(function(){
		$('#select_form').submit();
    });
});

</script>
</head>
<body style="background:#eef3f7;">
<#include "/views/ftl/base/head.ftl">
<div class="Main">
  <div class="dw">
<#include "/views/ftl/base/menu.ftl">
<#function a><#return "举报_List"></#function> 
<!--右边内容-->
<div class="Rightbox fl">
    <!--导航-->
    <div class="Bread_crbs clear">
      <div class="Bread_crbs_img fl"></div>
      <div class="Bread_crbs_text fl">
      	<a href="javascript:void(0);"><span>用户管理</span></a>
      	<span class="fnt_famy">></span>
      	<a href="javascript:void(0);"><span>举报</span></a>
      </div>
    </div>
      <!--搜索框-->
        <form action="${basePath }manager/Complain_complainList" id="select_form"  method="GET"> 
         <div class="searchBox fl">
        	<span class=" searchTitle">举报内容:</span>
        	
          		<input class="search_text" type="text" name="comText" placeholder="请输入关键字 " value="${(complainVo.comText)!''}"/>  
        
        	  <span class="searchTitle">举报人账号:</span>
        	
          		<input class="search_text" type="text"  style="width: 90px;"name="userId" placeholder="举报人id" value="${(complainVo.userId?c)!''}"/>  
        	
        	  <span class=" searchTitle">被举报人账号:</span>
        
          		<input class="search_text" type="text" name="comUserId" style="width: 90px;" placeholder="被举报人id" value="${(complainVo.comUserId?c)!'' }"/>  
     <br><br></div> 
          <div class="searchBox fl">
        	    <span style="font-size: 14px;color: #333333;">状态:</span>
                     　 <select name="isHandle" id="IsFailStatus"  class="sp">
           <option value="0"  <#if (complainVo.isHandle==0)>selected='true'</#if>>未处理</option>
           <option value="1"  <#if (complainVo.isHandle==1)>selected='true'</#if>>已处理</option>
          <option value="2"   <#if (complainVo.isHandle==2)>selected='true'</#if>>全部</option>
          </select>
          　
             <span style="font-size: 14px;color: #333333;">举报类型:</span> 　
           <select name="complainTypeId" class="sp" >
             <option value="0" <#if ((complainVo.complainTypeId)==0)>selected='true'</#if>>全部</option>
                 <#if (complainTypes??)> 
         <#if ((complainTypes?size)>0)>
          <#list complainTypes as complainTp>
          <option value="${complainTp.id}" <#if (complainVo.complainTypeId==complainTp.id)>selected='true'</#if>>${complainTp.typeName}</option>
        </#list>
          </#if>
          </#if> 
          </select> 	</div> <a href="javascript:void(0);" id="search_button" class="search_btn fl" align="center"><span >搜索</span></a> 

        </form>

        
       
        <div class="clear"></div>  
        <!--表格列表-->
        <div class="Table">
          <table id="table" cellpadding="0" cellspacing="1">
            <tbody>
              <tr id="gl">			 
             <td>举报类型</td>
             <td>举报人</td>
             <td>被举报人</td>
             <td>举报内容</td>
             <td>IP</td>
             <td>创建时间</td>
             <td>处理状态</td>
             <td>处理时间</td>
             <td>处理情况描述</td>
             <td>操作</td>
             </tr>
            <#if (pager.list??)> 
           <#if ((pager.list?size)>0)>
           <#list pager.list as complain>
     		<tr>
			<td>
			 <#if (complainTypes??)> 
           <#if ((complainTypes?size)>0)>
           <#list complainTypes as complainT>
			 <#if (complainT.id==complain.complainTypeId)>
			  ${(complainT.typeName)!''}
		    </#if>
		  </#list>
          </#if>
          </#if>
			
			</td>
          	<td><a href="${basePath }manager/User_userInfo?userId=${complain.userId?c}" target="_blank">${(complain.userId?c)!''}</a></td>
          	<td><a href="${basePath }manager/User_userInfo?userId=${complain.comUserId?c}" target="_blank">${(complain.comUserId?c)!''}</a></td>
          	<td>${(complain.comText)!''}</td>
          	<td>${(complain.ip)!''}</td>
          	<td>${(complain.createTime)!''}</td>
            <td>
             <#if (complain.isHandle==0)>
        	
			  未处理
			  </#if>
			 <#if (complain.isHandle==1)>
			  已处理
			  </#if>
            </td>
            <td>${(complain.handleTime)!''}</td>
             <td>
              <input type="text" class="newInput2" id="a1" value="${(complain.handleText)!''}">
              <input type="hidden" id="complainId" value=${(complain.id)!''} >
			 <span id="oa1"> ${(complain.handleText)!''}</span>
         		
            </td>
           <td class="tbl_btn">
               <#if (complain.isHandle==0)>
                 <a href="javascript:;"><span id="cancel">取消</span></a>
                  <a href="javascript:;"><span id="green">处理</span></a>
                 <a href="javascript:;"><span id="save">保存</span></a>
                   </#if>
                   <#if (complain.isHandle==1)><a href="javascript:;">已处理</a></#if>
                </td>
              </tr>
  			</#list>
          </#if>
          </#if>
            </tbody>
          </table>
        </div>
    <!--翻页按钮-->
  	<#import "../../base/pager.ftl" as p>
   	<@p.pager pager = pager baseUrl = "/manager/Complain_complainList" parameterMap={"userId":(userId)!'',"comText":(comText)!'',"comUserId":(comUserId)!'',"isHandle":(isHandle)!'',"complainTypeId":(complainTypeId)!''} /> 
</div>
<script type="text/javascript">
$(document).ready(function(){

	$("input#a1").hide();	
	$("span#save").hide();
	$("span#cancel").hide();
	$("span#green").click(function(){ 
	var obj= $(this).parent().parent().parent();
	obj.find("#a1").show();
	obj.find("#save").show();//保存按钮
	obj.find("#cancel").show();//取消按钮
	obj.find("#green").hide();//编辑按钮	
	obj.find("#oa1").hide();
	});
	$("span#cancel").click(function(){ 
		var obj= $(this).parent().parent().parent();
		obj.find("#a1").hide();	
		obj.find("#save").hide();//保存按钮
		obj.find("#cancel").hide();//取消按钮
		obj.find("#green").show();//编辑按钮
		obj.find("#oa1").show();		
		});
	$("span#save").click(function(){ 
		var obj= $(this).parent().parent().parent();	
		if(obj.find("#a1").val()==null||obj.find("#a1").val()==''){
			alert("处理情况描述不能为空!");
			return false;
		}
		$.ajax({ 
			url : "${basePath }manager/Complain_updateComplain",
			data : { 
				id : obj.find("#complainId").val(),
				handleText : obj.find("#a1").val(),
				isHandle: 1	
			}, 
			dataType :"JSON",
			cache : false, 
			type : "POST",
			success : function(dat){
				if(dat.code==1){
					alert(dat.msg);
					location.reload();	 
				} 
				if(dat.code==0){
					alert(dat.msg);	
				} 
			}
		});
		
		});
	});

</script>
</body>
</html>

